module bpu #(parameter ADDRESS_WIDTH = 32,
			 parameter TABLE_WIDTH = 4)
			(input isBranchID, 						//instruction in ID is a branch?
			 input isJumpID,
			 input [ADDRESS_WIDTH-1:0] instrAddrID, //address of instruction in ID
			 input [ADDRESS_WIDTH-1:0] branchAddrFetch, //address for fetch to branch to (target)
																//(only needed for static prediction)
			
			 input branchingEX,					    //EX result indicates a branch!
			 input branchPredictedEX,				//BPU predicted branch for instruction currently in EX?
			 input [ADDRESS_WIDTH-1:0] instrAddrEX,  //address of instruction in EX
			 input [ADDRESS_WIDTH-1:0] branchAddrEX, //absolute destination address of instruction in EX
			
			
			 output branchFetch, 	//fetch should branch to address?
			 output branchExecute	//misguessed and need to correct
			);
	
	wire branchPredictionLogic;
	assign branchPredictionLogic = branchAddrFetch < instrAddrID;
	assign branchFetch = (isBranchID && branchPredictionLogic) || isJumpID;
	assign branchExecute = (branchingEX ^ branchPredictedEX);   //predicted branch and aren't, didn't predict branch and am
endmodule